﻿using System;
using System.Collections.Generic;
using System.Text;
using IAM.Interface.Common.Providers;
using IAM.Interface.Common.Encrypt;

namespace IAM.Interface.Model
{
    /// <summary>
    /// 传送参数
    /// </summary>
    public class TransmissionParameter
    {
        #region 属性
        private string _appname = "";
        private string _url = "";
        private string _personnelindex = "";
        private string _key = "";
        private ProviderEnum _providerenum = ProviderEnum.Http;

        /// <summary>
        /// 系统名称
        /// </summary>
        public string AppName
        {
            get
            {
                return _appname;
            }
            set
            {
                _appname = value;
            }
        }
        /// <summary>
        /// 访问路径
        /// </summary>
        public string URL
        {
            get
            {
                return _url;
            }
            set
            {
                _url = value;
            }
        }
        /// <summary>
        /// 人员信息主索引字段
        /// </summary>
        public string PersonnelIndex
        {
            get
            {
                return _personnelindex;
            }
            set
            {
                _personnelindex = value;
            }
        }
        /// <summary>
        /// 加密密钥[16位]
        /// </summary>
        public string Key
        {
            get
            {
                return _key;
            }
            set
            {
                string encrypt = value;
                EncryptDecrypt ed = new EncryptDecrypt();
                ed.Key = ed.GenerateKey();
                _key = ed.Decrypt(encrypt);
            }
        }
        public ProviderEnum ProviderEnum
        {
            get
            {
                return _providerenum;
            }
            set
            {
                _providerenum = value;
            }
        }
        #endregion
    }
}
